Skip to content

feat(react-headless-components-preview): add TagPicker#36285

Open
mainframev wants to merge 2 commits into
microsoft:masterfrom
mainframev:feat/create-headless-tag-picker
Open

feat(react-headless-components-preview): add TagPicker#36285
mainframev wants to merge 2 commits into
microsoft:masterfrom
mainframev:feat/create-headless-tag-picker

Conversation

@mainframev
Copy link
Copy Markdown
Contributor

@mainframev mainframev commented Jun 4, 2026

Adds a headless TagPicker to @fluentui/react-headless-components-preview - a composite, style-free picker that lets users select tags from a filterable list of options

  • Reuses base hooks, not styled components - wraps useTagPickerBase_unstable, useTagPickerControlBase_unstable, useTagPickerInputBase_unstable,
    useTagPickerButtonBase_unstable, useTagPickerContext_unstable (from @fluentui/react-tag-picker), useTagGroupBase_unstable (@fluentui/react-tags), and the headless
    Dropdown's useOption/useListboxSlot (over @fluentui/react-combobox).
  • Renders are re-exported from @fluentui/react-tag-picker where the only difference from v9 is the intentionally-stripped size/appearance styling props (TagPickerControl, TagPickerInput, TagPickerGroup); TagPickerList/TagPickerOption keep thin local renders because their slot component types differ structurally from
    v9.
  • Navigation - options use the v9 useActiveDescendant model (focus stays on the trigger; listbox has no roving tabindex), consistent with the headless Combobox/Dropdown. Selected tags use the native WICG focusgroup attribute in place of Tabster's useArrowNavigationGroup.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-headless-components-preview
react-headless-components-preview: entire library
198.183 kB
56.549 kB
223.706 kB
64.724 kB
25.523 kB
8.175 kB

🤖 This report was generated against 23c05d1de3c0bcb9e84e77d534cbc6df33a974a5

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

Pull request demo site: URL

@mainframev mainframev force-pushed the feat/create-headless-tag-picker branch 3 times, most recently from 009b3f7 to 85e4ed8 Compare June 4, 2026 20:00
@mainframev mainframev force-pushed the feat/create-headless-tag-picker branch from 85e4ed8 to c78d12c Compare June 4, 2026 21:03
@mainframev mainframev requested a review from Copilot June 4, 2026 21:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new headless TagPicker surface to @fluentui/react-headless-components-preview, along with Storybook examples and API/package wiring so consumers can compose TagPicker behavior without bundled styles.

Changes:

  • Introduces the headless TagPicker root + subcomponents (Control/Input/Button/Group/List/Option/OptionGroup) and re-exports the relevant base utilities (useTagPickerFilter, useTagPickerContext_unstable).
  • Adds a full Storybook story set (default, filtering, grouping, single-select, no-popover, truncation, secondary action) and shared CSS-module styling/helpers.
  • Updates package exports, dependencies, API report, bundle-size fixture, and adds a beachball change file.

Reviewed changes

Copilot reviewed 53 out of 53 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/react-components/react-headless-components-preview/stories/src/TagPicker/utils.tsx Shared story helpers (initials/media, option/tag render helpers).
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerDefault.stories.tsx Baseline multiselect TagPicker story.
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerFiltering.stories.tsx Filtering story using useTagPickerFilter.
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerGrouped.stories.tsx Grouped options story using TagPickerOptionGroup.
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerSingleSelect.stories.tsx Single-select pattern story (external state control).
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerSecondaryAction.stories.tsx Story demonstrating secondaryAction slot on the control.
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerTruncatedText.stories.tsx Story demonstrating CSS-driven truncation.
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerNoPopover.stories.tsx Story demonstrating noPopover + free-text entry.
packages/react-components/react-headless-components-preview/stories/src/TagPicker/TagPickerDescription.md Component docs page content for the TagPicker story set.
packages/react-components/react-headless-components-preview/stories/src/TagPicker/tag-picker.module.css CSS module used by TagPicker stories (control/list/tag/option styling).
packages/react-components/react-headless-components-preview/stories/src/TagPicker/index.stories.tsx Storybook index/metadata + exports for the TagPicker story group.
packages/react-components/react-headless-components-preview/library/src/tag-picker.ts Public subpath entry point re-exporting headless TagPicker API.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/index.ts Barrel exports for TagPicker and subcomponents.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPicker.types.ts Headless TagPicker prop/type shaping (omits styled-only props).
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPicker.tsx Headless TagPicker root component wiring state + context + render.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/useTagPicker.ts Headless TagPicker state composition (base hook + positioning refs).
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/useTagPickerContextValues.ts TagPicker context value assembly for subcomponents.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/renderTagPicker.tsx Re-export of base renderTagPicker_unstable as renderTagPicker.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerControl/TagPickerControl.tsx Headless control component wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerControl/useTagPickerControl.ts Control state wrapper adding data-* flags.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerControl/renderTagPickerControl.tsx Control renderer re-export wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerControl/TagPickerControl.types.ts Control state typing incl. internal slots and data-* flags.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerControl/index.ts Control barrel exports.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerInput/TagPickerInput.tsx Headless input component wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerInput/useTagPickerInput.ts Input state wrapper + ArrowLeft/Backspace focus behavior.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerInput/renderTagPickerInput.tsx Input renderer re-export wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerInput/TagPickerInput.types.ts Input state typing incl. data-disabled.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerInput/index.ts Input barrel exports.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerButton/TagPickerButton.tsx Headless button trigger component wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerButton/useTagPickerButton.ts Button trigger wrapper adding data-disabled.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerButton/renderTagPickerButton.tsx Button renderer implementation using slots.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerButton/TagPickerButton.types.ts Button trigger state typing incl. data-disabled.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerButton/index.ts Button trigger barrel exports.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerGroup/TagPickerGroup.tsx Headless selected-tags group wrapper (adds TagGroup context).
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerGroup/useTagPickerGroup.ts Group state wrapper (dismiss wiring + focusgroup attribute + data-*).
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerGroup/renderTagPickerGroup.tsx Group renderer re-export wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerGroup/TagPickerGroup.types.ts Group state typing incl. focusgroup + data-disabled.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerGroup/index.ts Group barrel exports.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerList/TagPickerList.tsx Headless list/popover wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerList/useTagPickerList.ts List state wrapper (Listbox slot + refs + id/role wiring).
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerList/renderTagPickerList.tsx List renderer implementation using slots.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerList/TagPickerList.types.ts List props/state typing.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerList/index.ts List barrel exports.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerOption/TagPickerOption.tsx Headless option component wrapper.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerOption/useTagPickerOption.ts Option wrapper adding option-class marker + media/secondary slots.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerOption/renderTagPickerOption.tsx Option renderer (media + content + secondary).
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerOption/TagPickerOption.types.ts Option props/state typing for extra slots.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPickerOption/index.ts Option barrel exports.
packages/react-components/react-headless-components-preview/library/src/components/TagPicker/TagPicker.test.tsx Unit coverage for core rendering/roles/classes/focusgroup/disabled behavior.
packages/react-components/react-headless-components-preview/library/package.json Adds dependency on @fluentui/react-tag-picker and exports ./tag-picker.
packages/react-components/react-headless-components-preview/library/etc/tag-picker.api.md API Extractor report for the new TagPicker subpath.
packages/react-components/react-headless-components-preview/library/bundle-size/AllComponents.fixture.js Ensures TagPicker is included in bundle-size checks.
change/@fluentui-react-headless-components-preview-7694d78b-9ac6-40a0-8490-31128315e61a.json Beachball change file for publishing the new headless TagPicker surface.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mainframev mainframev marked this pull request as ready for review June 4, 2026 22:43
@mainframev mainframev requested a review from a team as a code owner June 4, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants